home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
djgpp
/
tktdoc
/
qmake.doc
< prev
next >
Wrap
Text File
|
1994-08-11
|
6KB
|
190 lines
QMAKE A SIMPLE MAKE UTILITY
QMAKE is a simple make utility that is provided with the toolkit to
allow you to maintain, update and regenerate groups of programs.
You may of course use another make utility if you have one that you
are already using.
Syntax
qmake [-f makefile] [-hinpqrstx] [macro=val ...]
[target(s) ...]
Description
Qmake allows the developer to maintain, update, and regenerate groups
of computer programs. The following is a brief description of all
options and some special names:
-f, makefile
Description file name. makefile is assumed to be the
name of a description file.
-h,
Help. Prints syntax and valid parameters.
-i,
Ignore error codes returned by invoked commands. This
mode is entered if the fake target name .IGNORE appears in the description
file.
-n,
No execute mode. Print commands, but do not execute
them.
-p,
Print out the complete set of macro definitions and
target descriptions.
-q,
Question. The make command returns a zero or non-zero
status code depending on whether the target file is or is not up-to-date.
-r,
Do not use the built-in rules.
-s,
Silent mode. Do not print command lines before executing.
This mode is also entered if the fake target name .SILENT appears
in the description file.
-t,
Touch the target files (causing them to be up- to-date)
rather than issue the usual commands.
-v,
Make verbosely
-x,
Use spaces instead of tabs for start of action lines.
If your makefile does not have a hard tab character at the beginning
of each action line in the makefile then you will need to use this
switch which waives that requirement. This switch is useful and is
often put into the QMAKE environment variable so that it will always
be invoked.
.DEFAULT,
If a file must be made but there are no explicit commands
or relevant built-in rules, the commands associated with the name
.DEFAULT are used if it exists.
.PRECIOUS,
Dependents of this target will not be removed when quit
or interrupt are hit.
.SILENT,
Same effect as the -s option.
.IGNORE,
Same effect as the -i option.
Qmake executes commands in makefile to update one or more target names.
Name is typically a program. If no -f option is present makefile is
taken as the default. An environment variable called QMAKE can be
used to specify the makefile name, e.g. SET QMAKE=-f HCLE .
Qmake updates a target only if its dependents are newer than the target.
All prerequisite files of a target are added recursively to the list
of targets.
makefile contains a sequence of entries that specify dependencies.
The first line of an entry is a blank-separated, non-null list of
targets, then a :, then a (possibly null) list of prerequisite files
or dependencies. Text following a ; and all following lines that begin
with a tab are shell commands to be executed to update the target.
The first non-empty line that does not begin with a tab or # begins
a new dependency or macro definition. Shell commands may be continued
across lines with the <<backslash>><<new-line>> sequence. Everything printed
by qmake (except the initial tab) is passed directly to the command
shell as is.
Sharp (#) and new-line surround comments.
Commands returning non-zero status normally terminate qmake. If the
-i option is present, or the entry .IGNORE: appears in a makefile,
or the initial character sequence of the command contains -, the error
is ignored.
Environment
The makefile processed by qmake can be specified through an environment
variable called qmake. This is of the form:
SET QMAKE=-x -f filename
When qmake is invoked with no filename specified on the command line
it checks for an environment variable. If this variable exists, the
file specified is used as the input file for qmake.
Include Files
If the string include appears as the first seven letters of a line
in a makefile, and is followed by a blank or a tab, the rest of the
line is assumed to be a filename and will be read by the current invocation,
after substituting for any macros.
Macros
Entries of the form string1 = string2 are macro definitions. string2
is defined as all characters up to a comment character or an unescaped
new-line. Subsequent appearances of $(string1[:subst1=[subst2]]) are
replaced by string2. The parentheses are optional if a single character
macro name is used and there is no substitute sequence. The optional
:subst1=subst2 is a substitute sequence. If it is specified, all non-overlapping
occurrences of subst1 in the named macro are replaced by subst2. Strings
(for the purposes of this type of substitution) are delimited by blanks,
tabs, new-line characters, and beginnings of lines.
Internal Macros
There are four internally maintained macros that are useful for writing
rules for building targets.
$*
The macro $* stands for the filename part of the current
dependent with the suffix deleted. It is evaluated only for inference
rules.
$@
The $@ macro stands for the full target name of the
current target. It is evaluated only for explicitly named dependencies.
.DEFAULT
This is a rule. It is the module that is out-of-date
with respect to the target (i.e., the ``manufactured'' dependent file
name). Thus, in the .c.obj rule, the
.c.obj:
hc386 -c $*.c
or:
.c.obj:
hc386 -c $
$?
The $? macro is evaluated when explicit rules from the
makefile are evaluated. It is the list of prerequisites that are out-of-date
with respect to the target; essentially, those modules which must
be rebuilt.